package lagou.user.server.lagouuser.service.impl;

import lagou.user.server.lagouuser.dao.UserTokenDao;
import lagou.user.server.lagouuser.entity.UserToken;
import lagou.user.server.lagouuser.service.UserTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserTokenServiceImpl implements UserTokenService {

    @Autowired
    private UserTokenDao userTokenDao;

    @Override
    public int insertUserToken(String email, String token){
        UserToken userToken=new UserToken();
        userToken.setEmail(email);
        userToken.setToken(token);
        return userTokenDao.insertUserToken(userToken);
    }


    @Override
    public UserToken findUserBase(String email,String token){
        UserToken userToken=new UserToken();
        userToken.setEmail(email);
        userToken.setToken(token);
        return userTokenDao.findUserToken(userToken);
    }
}
